package com.ruoyi.faq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.faq.mapper.FaqCategoryMapper;
import com.ruoyi.faq.domain.FaqCategory;
import com.ruoyi.faq.service.IFaqCategoryService;

/**
 * FAQ分类Service业务层处理
 * 
 * @author jk
 * @date 2025-06-13
 */
@Service
public class FaqCategoryServiceImpl implements IFaqCategoryService 
{
    @Autowired
    private FaqCategoryMapper faqCategoryMapper;

    /**
     * 查询FAQ分类
     * 
     * @param id FAQ分类主键
     * @return FAQ分类
     */
    @Override
    public FaqCategory selectFaqCategoryById(Long id)
    {
        return faqCategoryMapper.selectFaqCategoryById(id);
    }

    /**
     * 查询FAQ分类列表
     * 
     * @param faqCategory FAQ分类
     * @return FAQ分类
     */
    @Override
    public List<FaqCategory> selectFaqCategoryList(FaqCategory faqCategory)
    {
        return faqCategoryMapper.selectFaqCategoryList(faqCategory);
    }

    /**
     * 新增FAQ分类
     * 
     * @param faqCategory FAQ分类
     * @return 结果
     */
    @Override
    public int insertFaqCategory(FaqCategory faqCategory)
    {
        faqCategory.setCreateTime(DateUtils.getNowDate());
        return faqCategoryMapper.insertFaqCategory(faqCategory);
    }

    /**
     * 修改FAQ分类
     * 
     * @param faqCategory FAQ分类
     * @return 结果
     */
    @Override
    public int updateFaqCategory(FaqCategory faqCategory)
    {
        faqCategory.setUpdateTime(DateUtils.getNowDate());
        return faqCategoryMapper.updateFaqCategory(faqCategory);
    }

    /**
     * 批量删除FAQ分类
     * 
     * @param ids 需要删除的FAQ分类主键
     * @return 结果
     */
    @Override
    public int deleteFaqCategoryByIds(Long[] ids)
    {
        return faqCategoryMapper.deleteFaqCategoryByIds(ids);
    }

    /**
     * 删除FAQ分类信息
     * 
     * @param id FAQ分类主键
     * @return 结果
     */
    @Override
    public int deleteFaqCategoryById(Long id)
    {
        return faqCategoryMapper.deleteFaqCategoryById(id);
    }
}
